import 'package:aio/aio.dart';

///派工审核实体类

///所属工序或者班组
class OtherWorkApply extends RollerBean {
  String? Id = null; //工序id 或班组id
  String? Name = null; //工序名称 或班组名称

  @override
  fromJson(Map<String, dynamic> json) {
    // TODO: implement fromJson
    super.fromJson(json);
    Id = json["Id"]?.toString() ?? "";
    if (StringUtils.isEmpty(Id)) {
      Id = json["id"]?.toString() ?? "";
    }
    Name = json["Name"]?.toString() ?? "";
    if (StringUtils.isEmpty(Name)) {
      Name = json["name"]?.toString() ?? "";
    }
    key = Id;
    value = Name;
  }

  @override
  instance() {
    // TODO: implement instance
    return OtherWorkApply();
  }

  @override
  Map<String, dynamic> toJson() {
    // TODO: implement toJson
    // var map = <String, dynamic>{};
    var map = super.toJson();
    map["Id"] = Id;
    map["Name"] = Name;
    return map;
  }
}

///工序，班组查询条件
///{"type":"Process"}//工序
// {"type":"Group","processId":""}//班组
class ProcessQuery extends BaseBean {
  String? type = null; //Process 工序；Group 班组
  String? processId = null; //工序id

  @override
  fromJson(Map<String, dynamic> json) {
    // TODO: implement fromJson
    type = json["type"]?.toString() ?? "";
    processId = json["processId"]?.toString() ?? "";
  }

  @override
  instance() {
    // TODO: implement instance
    return ProcessQuery();
  }

  @override
  Map<String, dynamic> toJson() {
    // TODO: implement toJson
    var map = <String, dynamic>{};
    map["type"] = type;
    map["processId"] = processId;
    return map;
  }
}
